import fix_path

from google.appengine.ext import webapp, deferred
from google.appengine.ext.webapp.util import run_wsgi_app 

from mover import *

import logging


class MarkerStatMover(webapp.RequestHandler): 
    def get(self): 
        self.response.headers['Content-Type'] = 'text/html' 
        mover = StatMover()
        logging.info("MarkerStatMover start  = %s" % (str(mover)))
        deferred.defer(mover.run,100,500)
        logging.info("MarkerStatMover end  = %s" % (str(mover)))
        pass



class Other(webapp.RequestHandler): 
    def get(self): 
        pass


application = webapp.WSGIApplication([('/mover/movestat.*', MarkerStatMover),
                                      ('/cleaner/.*', Other)], debug=True) 

def main(): 
     run_wsgi_app(application) 

if __name__ == '__main__': 
     main() 